package com.atu.poker.util;

import java.util.UUID;

import org.jasypt.util.text.BasicTextEncryptor;

public class UserUtil {

	/**
	 * 加密
	 * 
	 * @param password
	 * @return
	 */
	public static String encrypt(String password) {
		BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
		textEncryptor.setPassword("password");
		return textEncryptor.encrypt(password);
	}

	/**
	 * 解密
	 * 
	 * @param password
	 * @return
	 */
	public static String decrypt(String password) {
		BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
		textEncryptor.setPassword("password");
		return textEncryptor.decrypt(password);
	}

	/**
	 * 获取uuid
	 * @return
	 */
	public static String getUUID() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	}

}
